package com.pkk.cloud.support.common.admin.constand;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 资源常量类枚举
 * @author: peikunkun
 * @create: 2020-03-26 14:02
 **/
public class ResourceConstandEnum {

  /**
   * 资源描述
   *
   * @param <K>
   * @param <V>
   */
  public interface ResourceTypeInterface<K, V> {

    /**
     * 获取资源值
     *
     * @return
     */
    K value();


    /**
     * 获取资源描述
     *
     * @return
     */
    V desc();

  }


  /**
   * @Description: 资源类型的枚举类
   * @Author: peikunkun
   * @Date: 2020/3/26 0026 下午 2:09
   */
  @Getter
  @AllArgsConstructor
  public enum ResourceTypeEnum implements ResourceTypeInterface<Integer, String> {

    /**
     * 资源类型
     */
    CATEGORY(0, "分类"),
    MENU(1, "菜单"),
    BUTTON(2, "按钮"),
    ;

    private Integer value;
    private String desc;


    /**
     * 获取资源值
     *
     * @return
     */
    @Override
    public Integer value() {
      return value;
    }

    /**
     * 获取资源描述
     *
     * @return
     */
    @Override
    public String desc() {
      return desc;
    }
  }


}
